]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st_widget_recompute_style: short-circuit if the theme node is the same
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 15 Nov 2012 15:09:51 +0000 (15:09 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 15 Nov 2012 17:08:31 +0000 (17:08 +0000)
It appears to be somewhat common for st_widget_style_changed() to be
called when no style-relevant attributes have, in fact, changed. Now that
we cache theme nodes, we're likely to get the same theme node back from
the cache. If we do, we don't need to waste time asking whether its
geometry and painting are equal to itself: we can just note that nothing
really changed and get on with our lives.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=687465
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
src/st/st-widget.c

index 2a9b8da262f4838a8ef156332c01e15e7ac5a0df..b1218d3fb2b108dcf5fb6ea8f974bc5313ac22ac 100644 (file)
@@ -1532,6 +1532,12 @@ st_widget_recompute_style (StWidget    *widget,
   int transition_duration;
   gboolean paint_equal;
 
+  if (new_theme_node == old_theme_node)
+    {
+      widget->priv->is_style_dirty = FALSE;
+      return;
+    }
+
   if (!old_theme_node ||
       !st_theme_node_geometry_equal (old_theme_node, new_theme_node))
     clutter_actor_queue_relayout ((ClutterActor *) widget);